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
7b42e13c
Commit
7b42e13c
authored
Sep 26, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typescript: stricter typescript option
parent
ff108bd8
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
62 additions
and
45 deletions
+62
-45
public/app/features/alerting/alert_def.ts
+2
-0
public/app/features/alerting/alert_tab_ctrl.ts
+2
-1
public/app/features/panel/query_troubleshooter.ts
+2
-1
public/app/features/plugins/import_list/import_list.ts
+2
-0
public/app/features/plugins/plugin_edit_ctrl.ts
+1
-0
public/app/features/templating/editor_ctrl.ts
+1
-1
public/app/plugins/datasource/influxdb/query_ctrl.ts
+2
-1
public/app/plugins/panel/graph/data_processor.ts
+17
-15
public/app/plugins/panel/graph/graph.ts
+3
-0
public/app/plugins/panel/heatmap/heatmap_data_converter.ts
+28
-24
public/app/plugins/panel/table/transformers.ts
+1
-0
tsconfig.json
+1
-2
No files found.
public/app/features/alerting/alert_def.ts
View file @
7b42e13c
...
...
@@ -106,6 +106,8 @@ function getStateDisplayModel(state) {
};
}
}
throw
{
message
:
'Unknown alert state'
};
}
function
joinEvalMatches
(
matches
,
separator
:
string
)
{
...
...
public/app/features/alerting/alert_tab_ctrl.ts
View file @
7b42e13c
...
...
@@ -84,7 +84,7 @@ export class AlertTabCtrl {
});
}
getNotificationIcon
(
type
)
{
getNotificationIcon
(
type
)
:
string
{
switch
(
type
)
{
case
"email"
:
return
"fa fa-envelope"
;
case
"slack"
:
return
"fa fa-slack"
;
...
...
@@ -95,6 +95,7 @@ export class AlertTabCtrl {
case
"hipchat"
:
return
"fa fa-mail-forward"
;
case
"pushover"
:
return
"fa fa-mobile"
;
}
return
'fa fa-bell'
;
}
getNotifications
()
{
...
...
public/app/features/panel/query_troubleshooter.ts
View file @
7b42e13c
...
...
@@ -69,10 +69,11 @@ export class QueryTroubleshooterCtrl {
}
}
getClipboardText
()
{
getClipboardText
()
:
string
{
if
(
this
.
jsonExplorer
)
{
return
JSON
.
stringify
(
this
.
jsonExplorer
.
json
,
null
,
2
);
}
return
''
;
}
onRequestResponse
(
data
)
{
...
...
public/app/features/plugins/import_list/import_list.ts
View file @
7b42e13c
...
...
@@ -38,6 +38,8 @@ export class DashImportListCtrl {
});
},
500
);
});
}
else
{
return
Promise
.
resolve
();
}
});
}
...
...
public/app/features/plugins/plugin_edit_ctrl.ts
View file @
7b42e13c
...
...
@@ -79,6 +79,7 @@ export class PluginEditCtrl {
case
'app'
:
return
'icon-gf icon-gf-apps'
;
case
'page'
:
return
'icon-gf icon-gf-endpoint-tiny'
;
case
'dashboard'
:
return
'icon-gf icon-gf-dashboard'
;
default
:
return
'icon-gf icon-gf-apps'
;
}
}
...
...
public/app/features/templating/editor_ctrl.ts
View file @
7b42e13c
...
...
@@ -54,7 +54,7 @@ export class VariableEditorCtrl {
$scope
.
isValid
=
function
()
{
if
(
!
$scope
.
ctrl
.
form
.
$valid
)
{
return
;
return
false
;
}
if
(
!
$scope
.
current
.
name
.
match
(
/^
\w
+$/
))
{
...
...
public/app/plugins/datasource/influxdb/query_ctrl.ts
View file @
7b42e13c
...
...
@@ -352,12 +352,13 @@ export class InfluxQueryCtrl extends QueryCtrl {
this
.
panelCtrl
.
refresh
();
}
getTagValueOperator
(
tagValue
,
tagOperator
)
{
getTagValueOperator
(
tagValue
,
tagOperator
)
:
string
{
if
(
tagOperator
!==
'=~'
&&
tagOperator
!==
'!~'
&&
/^
\/
.*
\/
$/
.
test
(
tagValue
))
{
return
'=~'
;
}
else
if
((
tagOperator
===
'=~'
||
tagOperator
===
'!~'
)
&&
/^
(?!\/
.*
\/
$
)
/
.
test
(
tagValue
))
{
return
'='
;
}
return
null
;
}
getCollapsedText
()
{
...
...
public/app/plugins/panel/graph/data_processor.ts
View file @
7b42e13c
...
...
@@ -142,34 +142,34 @@ export class DataProcessor {
let
fields
=
[];
var
firstItem
=
dataList
[
0
];
let
fieldParts
=
[];
function
getPropertiesRecursive
(
obj
)
{
_
.
forEach
(
obj
,
(
value
,
key
)
=>
{
if
(
_
.
isObject
(
value
))
{
fieldParts
.
push
(
key
);
getPropertiesRecursive
(
value
);
}
else
{
if
(
!
onlyNumbers
||
_
.
isNumber
(
value
))
{
let
field
=
fieldParts
.
concat
(
key
).
join
(
'.'
);
fields
.
push
(
field
);
}
_
.
forEach
(
obj
,
(
value
,
key
)
=>
{
if
(
_
.
isObject
(
value
))
{
fieldParts
.
push
(
key
);
getPropertiesRecursive
(
value
);
}
else
{
if
(
!
onlyNumbers
||
_
.
isNumber
(
value
))
{
let
field
=
fieldParts
.
concat
(
key
).
join
(
'.'
);
fields
.
push
(
field
);
}
});
fieldParts
.
pop
();
}
});
fieldParts
.
pop
();
}
if
(
firstItem
.
type
===
'docs'
)
{
if
(
firstItem
.
datapoints
.
length
===
0
)
{
return
[];
}
getPropertiesRecursive
(
firstItem
.
datapoints
[
0
]);
return
fields
;
}
return
fields
;
}
getXAxisValueOptions
(
options
)
{
switch
(
this
.
panel
.
xaxis
.
mode
)
{
case
'time'
:
{
return
[];
}
case
'series'
:
{
return
[
{
text
:
'Avg'
,
value
:
'avg'
},
...
...
@@ -180,6 +180,8 @@ export class DataProcessor {
];
}
}
return
[];
}
pluckDeep
(
obj
:
any
,
property
:
string
)
{
...
...
public/app/plugins/panel/graph/graph.ts
View file @
7b42e13c
...
...
@@ -120,6 +120,8 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
if
(
panelWidth
===
0
)
{
return
true
;
}
return
false
;
}
function
drawHook
(
plot
)
{
...
...
@@ -385,6 +387,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
if
(
legendSideLastValue
!==
null
&&
panel
.
legend
.
rightSide
!==
legendSideLastValue
)
{
return
true
;
}
return
false
;
}
function
addTimeAxis
(
options
)
{
...
...
public/app/plugins/panel/heatmap/heatmap_data_converter.ts
View file @
7b42e13c
...
...
@@ -21,7 +21,7 @@ function elasticHistogramToHeatmap(seriesList) {
for
(
let
series
of
seriesList
)
{
let
bound
=
Number
(
series
.
alias
);
if
(
isNaN
(
bound
))
{
return
;
return
heatmap
;
}
for
(
let
point
of
series
.
datapoints
)
{
...
...
@@ -384,36 +384,40 @@ function isHeatmapDataEqual(objA: any, objB: any): boolean {
let
is_eql
=
!
emptyXOR
(
objA
,
objB
);
_
.
forEach
(
objA
,
(
xBucket
:
XBucket
,
x
)
=>
{
if
(
objB
[
x
])
{
if
(
objB
[
x
])
{
if
(
emptyXOR
(
xBucket
.
buckets
,
objB
[
x
].
buckets
))
{
is_eql
=
false
;
return
false
;
is_eql
=
false
;
return
false
;
}
_
.
forEach
(
xBucket
.
buckets
,
(
yBucket
:
YBucket
,
y
)
=>
{
if
(
objB
[
x
].
buckets
&&
objB
[
x
].
buckets
[
y
])
{
if
(
objB
[
x
].
buckets
&&
objB
[
x
].
buckets
[
y
])
{
if
(
objB
[
x
].
buckets
[
y
].
values
)
{
is_eql
=
_
.
isEqual
(
_
.
sortBy
(
yBucket
.
values
),
_
.
sortBy
(
objB
[
x
].
buckets
[
y
].
values
));
if
(
!
is_eql
)
{
return
false
;
}
is_eql
=
_
.
isEqual
(
_
.
sortBy
(
yBucket
.
values
),
_
.
sortBy
(
objB
[
x
].
buckets
[
y
].
values
));
if
(
!
is_eql
)
{
return
false
;
}
else
{
return
true
;
}
}
else
{
is_eql
=
false
;
return
false
;
is_eql
=
false
;
return
false
;
}
}
else
{
}
else
{
is_eql
=
false
;
return
false
;
}
});
}
});
if
(
!
is_eql
)
{
return
false
;
}
}
else
{
is_eql
=
false
;
return
false
;
return
true
;
}
}
else
{
is_eql
=
false
;
return
false
;
}
});
return
is_eql
;
...
...
@@ -425,11 +429,11 @@ function emptyXOR(foo: any, bar: any): boolean {
export
{
convertToHeatMap
,
elasticHistogramToHeatmap
,
convertToCards
,
mergeZeroBuckets
,
getMinLog
,
getValueBucketBound
,
isHeatmapDataEqual
,
calculateBucketSize
elasticHistogramToHeatmap
,
convertToCards
,
mergeZeroBuckets
,
getMinLog
,
getValueBucketBound
,
isHeatmapDataEqual
,
calculateBucketSize
};
public/app/plugins/panel/table/transformers.ts
View file @
7b42e13c
...
...
@@ -137,6 +137,7 @@ transformers['table'] = {
if
(
!
data
||
data
.
length
===
0
)
{
return
[];
}
return
data
[
0
].
columns
;
},
transform
:
function
(
data
,
panel
,
model
)
{
if
(
!
data
||
data
.
length
===
0
)
{
...
...
tsconfig.json
View file @
7b42e13c
...
...
@@ -12,7 +12,7 @@
"noEmitOnError"
:
false
,
"emitDecoratorMetadata"
:
false
,
"experimentalDecorators"
:
false
,
"noImplicitReturns"
:
fals
e
,
"noImplicitReturns"
:
tru
e
,
"noImplicitThis"
:
false
,
"noImplicitUseStrict"
:
false
,
"moduleResolution"
:
"classic"
...
...
@@ -26,5 +26,4 @@
"public/vendor/**/*"
,
"public/**/*.d.ts"
]
}
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