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
372ae7fd
Unverified
Commit
372ae7fd
authored
Feb 22, 2021
by
Torkel Ödegaard
Committed by
GitHub
Feb 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore: Fix strict errors, down to 416 (#31365)
parent
ad5514ec
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
62 additions
and
61 deletions
+62
-61
public/app/features/dashboard/state/PanelModel.ts
+6
-5
public/app/features/panel/query_ctrl.ts
+4
-4
public/app/features/profile/ChangePasswordPage.tsx
+2
-2
public/app/features/profile/UserProfileEdit.tsx
+4
-4
public/app/features/query/state/runRequest.test.ts
+5
-5
public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/aggregations.ts
+19
-17
public/app/plugins/datasource/mysql/query_ctrl.ts
+5
-6
public/app/plugins/panel/heatmap/rendering.ts
+13
-14
public/app/plugins/panel/stat/types.ts
+2
-2
public/app/plugins/panel/timeseries/config.ts
+1
-1
scripts/ci-check-strict.sh
+1
-1
No files found.
public/app/features/dashboard/state/PanelModel.ts
View file @
372ae7fd
...
...
@@ -107,15 +107,16 @@ const defaults: any = {
transparent
:
false
,
options
:
{},
datasource
:
null
,
title
:
''
,
};
export
class
PanelModel
implements
DataConfigSource
{
/* persisted id, used in URL to identify a panel */
id
:
number
;
editSourceId
:
number
;
gridPos
:
GridPos
;
type
:
string
;
title
:
string
;
id
!
:
number
;
editSourceId
?
:
number
;
gridPos
!
:
GridPos
;
type
!
:
string
;
title
!
:
string
;
alert
?:
any
;
scopedVars
?:
ScopedVars
;
repeat
?:
string
;
...
...
public/app/features/panel/query_ctrl.ts
View file @
372ae7fd
...
...
@@ -2,11 +2,11 @@ import _ from 'lodash';
import
{
auto
}
from
'angular'
;
export
class
QueryCtrl
{
target
:
any
;
datasource
:
any
;
panelCtrl
:
any
;
target
!
:
any
;
datasource
!
:
any
;
panelCtrl
!
:
any
;
panel
:
any
;
hasRawMode
:
boolean
;
hasRawMode
!
:
boolean
;
error
?:
string
|
null
;
isLastQuery
:
boolean
;
...
...
public/app/features/profile/ChangePasswordPage.tsx
View file @
372ae7fd
...
...
@@ -23,7 +23,7 @@ export const ChangePasswordPage: FC<Props> = ({ navModel }) => (
teams
:
Team
[],
orgs
:
UserOrg
[],
sessions
:
UserSession
[],
user
:
UserDTO
user
?
:
UserDTO
)
=>
{
return
(
<
Page
.
Contents
>
...
...
@@ -31,7 +31,7 @@ export const ChangePasswordPage: FC<Props> = ({ navModel }) => (
{
states
.
loadUser
?
(
<
LoadingPlaceholder
text=
"Loading user profile..."
/>
)
:
(
<
ChangePasswordForm
user=
{
user
}
onChangePassword=
{
api
.
changePassword
}
isSaving=
{
states
.
changePassword
}
/>
<
ChangePasswordForm
user=
{
user
!
}
onChangePassword=
{
api
.
changePassword
}
isSaving=
{
states
.
changePassword
}
/>
)
}
</
Page
.
Contents
>
);
...
...
public/app/features/profile/UserProfileEdit.tsx
View file @
372ae7fd
...
...
@@ -27,7 +27,7 @@ export const UserProfileEdit: FC<Props> = ({ navModel }) => (
teams
:
Team
[],
orgs
:
UserOrg
[],
sessions
:
UserSession
[],
user
:
UserDTO
user
?
:
UserDTO
)
=>
{
return
(
<
Page
.
Contents
>
...
...
@@ -37,7 +37,7 @@ export const UserProfileEdit: FC<Props> = ({ navModel }) => (
<
UserProfileEditForm
updateProfile=
{
api
.
updateUserProfile
}
isSavingUser=
{
states
.
updateUserProfile
}
user=
{
user
}
user=
{
user
!
}
/>
)
}
<
SharedPreferences
resourceUri=
"user"
/>
...
...
@@ -49,14 +49,14 @@ export const UserProfileEdit: FC<Props> = ({ navModel }) => (
setUserOrg=
{
api
.
setUserOrg
}
loadOrgs=
{
api
.
loadOrgs
}
orgs=
{
orgs
}
user=
{
user
}
user=
{
user
!
}
/>
<
UserSessions
isLoading=
{
states
.
loadSessions
}
loadSessions=
{
api
.
loadSessions
}
revokeUserSession=
{
api
.
revokeUserSession
}
sessions=
{
sessions
}
user=
{
user
}
user=
{
user
!
}
/>
</>
)
}
...
...
public/app/features/query/state/runRequest.test.ts
View file @
372ae7fd
...
...
@@ -30,13 +30,13 @@ jest.mock('app/features/dashboard/services/DashboardSrv', () => ({
}));
class
ScenarioCtx
{
ds
:
DataSourceApi
;
request
:
DataQueryRequest
;
subscriber
:
Subscriber
<
DataQueryResponse
>
;
ds
!
:
DataSourceApi
;
request
!
:
DataQueryRequest
;
subscriber
!
:
Subscriber
<
DataQueryResponse
>
;
isUnsubbed
=
false
;
setupFn
:
()
=>
void
=
()
=>
{};
results
:
PanelData
[];
subscription
:
Subscription
;
results
!
:
PanelData
[];
subscription
!
:
Subscription
;
wasStarted
=
false
;
error
:
Error
|
null
=
null
;
toStartTime
=
dateTime
();
...
...
public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/aggregations.ts
View file @
372ae7fd
...
...
@@ -49,11 +49,11 @@ export interface MetricAggregationWithInlineScript extends BaseMetricAggregation
};
}
interface
Count
extends
BaseMetricAggregation
{
export
interface
Count
extends
BaseMetricAggregation
{
type
:
'count'
;
}
interface
Average
export
interface
Average
extends
MetricAggregationWithField
,
MetricAggregationWithMissingSupport
,
MetricAggregationWithInlineScript
{
...
...
@@ -64,7 +64,7 @@ interface Average
};
}
interface
Sum
extends
MetricAggregationWithField
,
MetricAggregationWithInlineScript
{
export
interface
Sum
extends
MetricAggregationWithField
,
MetricAggregationWithInlineScript
{
type
:
'sum'
;
settings
?:
{
script
?:
string
;
...
...
@@ -72,7 +72,7 @@ interface Sum extends MetricAggregationWithField, MetricAggregationWithInlineScr
};
}
interface
Max
extends
MetricAggregationWithField
,
MetricAggregationWithInlineScript
{
export
interface
Max
extends
MetricAggregationWithField
,
MetricAggregationWithInlineScript
{
type
:
'max'
;
settings
?:
{
script
?:
string
;
...
...
@@ -80,7 +80,7 @@ interface Max extends MetricAggregationWithField, MetricAggregationWithInlineScr
};
}
interface
Min
extends
MetricAggregationWithField
,
MetricAggregationWithInlineScript
{
export
interface
Min
extends
MetricAggregationWithField
,
MetricAggregationWithInlineScript
{
type
:
'min'
;
settings
?:
{
script
?:
string
;
...
...
@@ -131,21 +131,21 @@ export interface UniqueCount extends MetricAggregationWithField {
};
}
interface
RawDocument
extends
BaseMetricAggregation
{
export
interface
RawDocument
extends
BaseMetricAggregation
{
type
:
'raw_document'
;
settings
?:
{
size
?:
string
;
};
}
interface
RawData
extends
BaseMetricAggregation
{
export
interface
RawData
extends
BaseMetricAggregation
{
type
:
'raw_data'
;
settings
?:
{
size
?:
string
;
};
}
interface
Logs
extends
BaseMetricAggregation
{
export
interface
Logs
extends
BaseMetricAggregation
{
type
:
'logs'
;
}
...
...
@@ -154,7 +154,7 @@ export interface BasePipelineMetricAggregation extends MetricAggregationWithFiel
pipelineAgg
?:
string
;
}
interface
PipelineMetricAggregationWithMultipleBucketPaths
extends
BaseMetricAggregation
{
export
interface
PipelineMetricAggregationWithMultipleBucketPaths
extends
BaseMetricAggregation
{
type
:
PipelineMetricAggregationType
;
pipelineVariables
?:
PipelineVariable
[];
}
...
...
@@ -166,26 +166,27 @@ export interface MovingAverageModelOption {
value
:
MovingAverageModel
;
}
interface
BaseMovingAverageModelSettings
{
export
interface
BaseMovingAverageModelSettings
{
model
:
MovingAverageModel
;
window
:
number
;
predict
:
number
;
}
interface
MovingAverageSimpleModelSettings
extends
BaseMovingAverageModelSettings
{
export
interface
MovingAverageSimpleModelSettings
extends
BaseMovingAverageModelSettings
{
model
:
'simple'
;
}
interface
MovingAverageLinearModelSettings
extends
BaseMovingAverageModelSettings
{
export
interface
MovingAverageLinearModelSettings
extends
BaseMovingAverageModelSettings
{
model
:
'linear'
;
}
interface
MovingAverageEWMAModelSettings
extends
BaseMovingAverageModelSettings
{
export
interface
MovingAverageEWMAModelSettings
extends
BaseMovingAverageModelSettings
{
model
:
'ewma'
;
alpha
:
number
;
minimize
:
boolean
;
}
interface
MovingAverageHoltModelSettings
extends
BaseMovingAverageModelSettings
{
export
interface
MovingAverageHoltModelSettings
extends
BaseMovingAverageModelSettings
{
model
:
'holt'
;
settings
:
{
alpha
?:
number
;
...
...
@@ -193,7 +194,8 @@ interface MovingAverageHoltModelSettings extends BaseMovingAverageModelSettings
};
minimize
:
boolean
;
}
interface
MovingAverageHoltWintersModelSettings
extends
BaseMovingAverageModelSettings
{
export
interface
MovingAverageHoltWintersModelSettings
extends
BaseMovingAverageModelSettings
{
model
:
'holt_winters'
;
settings
:
{
alpha
?:
number
;
...
...
@@ -232,7 +234,7 @@ export const isHoltWintersMovingAverage = (
metric
:
MovingAverage
|
MovingAverage
<
'holt_winters'
>
):
metric
is
MovingAverage
<
'holt_winters'
>
=>
metric
.
settings
?.
model
===
'holt_winters'
;
interface
MovingFunction
extends
BasePipelineMetricAggregation
{
export
interface
MovingFunction
extends
BasePipelineMetricAggregation
{
type
:
'moving_fn'
;
settings
?:
{
window
?:
string
;
...
...
@@ -255,7 +257,7 @@ export interface SerialDiff extends BasePipelineMetricAggregation {
};
}
interface
CumulativeSum
extends
BasePipelineMetricAggregation
{
export
interface
CumulativeSum
extends
BasePipelineMetricAggregation
{
type
:
'cumulative_sum'
;
settings
?:
{
format
?:
string
;
...
...
public/app/plugins/datasource/mysql/query_ctrl.ts
View file @
372ae7fd
...
...
@@ -25,7 +25,7 @@ export class MysqlQueryCtrl extends QueryCtrl {
formats
:
any
[];
lastQueryError
?:
string
;
showHelp
:
boolean
;
showHelp
!
:
boolean
;
queryModel
:
MysqlQuery
;
metaBuilder
:
MysqlMetaQuery
;
...
...
@@ -34,10 +34,10 @@ export class MysqlQueryCtrl extends QueryCtrl {
whereAdd
:
any
;
timeColumnSegment
:
any
;
metricColumnSegment
:
any
;
selectMenu
:
any
[];
selectParts
:
SqlPart
[][];
groupParts
:
SqlPart
[];
whereParts
:
SqlPart
[];
selectMenu
:
any
[]
=
[]
;
selectParts
:
SqlPart
[][]
=
[]
;
groupParts
:
SqlPart
[]
=
[]
;
whereParts
:
SqlPart
[]
=
[]
;
groupAdd
:
any
;
/** @ngInject */
...
...
@@ -136,7 +136,6 @@ export class MysqlQueryCtrl extends QueryCtrl {
}
buildSelectMenu
()
{
this
.
selectMenu
=
[];
const
aggregates
=
{
text
:
'Aggregate Functions'
,
value
:
'aggregate'
,
...
...
public/app/plugins/panel/heatmap/rendering.ts
View file @
372ae7fd
...
...
@@ -33,20 +33,20 @@ export default function rendering(scope: any, elem: any, attrs: any, ctrl: any)
return
new
HeatmapRenderer
(
scope
,
elem
,
attrs
,
ctrl
);
}
export
class
HeatmapRenderer
{
width
:
number
;
height
:
number
;
width
=
200
;
height
=
200
;
yScale
:
any
;
xScale
:
any
;
chartWidth
:
number
;
chartHeight
:
number
;
chartTop
:
number
;
chartBottom
:
number
;
yAxisWidth
:
number
;
xAxisHeight
:
number
;
cardPadding
:
number
;
cardRound
:
number
;
cardWidth
:
number
;
cardHeight
:
number
;
chartWidth
=
0
;
chartHeight
=
0
;
chartTop
=
0
;
chartBottom
=
0
;
yAxisWidth
=
0
;
xAxisHeight
=
0
;
cardPadding
=
0
;
cardRound
=
0
;
cardWidth
=
0
;
cardHeight
=
0
;
colorScale
:
any
;
opacityScale
:
any
;
mouseUpHandler
:
any
;
...
...
@@ -61,6 +61,7 @@ export class HeatmapRenderer {
padding
:
any
;
margin
:
any
;
dataRangeWidingFactor
:
number
;
constructor
(
private
scope
:
any
,
private
elem
:
any
,
attrs
:
any
,
private
ctrl
:
any
)
{
// $heatmap is JQuery object, but heatmap is D3
this
.
$heatmap
=
this
.
elem
.
find
(
'.heatmap-panel'
);
...
...
@@ -75,9 +76,7 @@ export class HeatmapRenderer {
this
.
padding
=
{
left
:
0
,
right
:
0
,
top
:
0
,
bottom
:
0
};
this
.
margin
=
{
left
:
25
,
right
:
15
,
top
:
10
,
bottom
:
20
};
this
.
dataRangeWidingFactor
=
DATA_RANGE_WIDING_FACTOR
;
this
.
ctrl
.
events
.
on
(
PanelEvents
.
render
,
this
.
onRender
.
bind
(
this
));
this
.
ctrl
.
tickValueFormatter
=
this
.
tickValueFormatter
.
bind
(
this
);
/////////////////////////////
...
...
public/app/plugins/panel/stat/types.ts
View file @
372ae7fd
...
...
@@ -23,8 +23,8 @@ export interface StatPanelOptions extends SingleStatBaseOptions {
textMode
:
BigValueTextMode
;
}
export
function
addStandardDataReduceOptions
(
builder
:
PanelOptionsEditorBuilder
<
SingleStatBaseOptions
>
,
export
function
addStandardDataReduceOptions
<
T
extends
SingleStatBaseOptions
>
(
builder
:
PanelOptionsEditorBuilder
<
T
>
,
includeOrientation
=
true
,
includeFieldMatcher
=
true
,
includeTextSizes
=
true
...
...
public/app/plugins/panel/timeseries/config.ts
View file @
372ae7fd
...
...
@@ -261,7 +261,7 @@ export function addAxisConfig(
}
}
export
function
addLegendOptions
(
builder
:
PanelOptionsEditorBuilder
<
OptionsWithLegend
>
)
{
export
function
addLegendOptions
<
T
extends
OptionsWithLegend
>
(
builder
:
PanelOptionsEditorBuilder
<
T
>
)
{
builder
.
addRadio
({
path
:
'legend.displayMode'
,
...
...
scripts/ci-check-strict.sh
View file @
372ae7fd
...
...
@@ -3,7 +3,7 @@ set -e
echo
-e
"Collecting code stats (typescript errors & more)"
ERROR_COUNT_LIMIT
=
4
52
ERROR_COUNT_LIMIT
=
4
16
ERROR_COUNT
=
"
$(
./node_modules/.bin/tsc
--project
tsconfig.json
--noEmit
--strict
true
|
grep
-oP
'Found \K(\d+)'
)
"
if
[
"
$ERROR_COUNT
"
-gt
$ERROR_COUNT_LIMIT
]
;
then
...
...
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