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
a8547ae3
Commit
a8547ae3
authored
Aug 30, 2018
by
Patrick O'Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added this:any to functions and changed functions to arrowfunctions
parent
80d6ef53
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
53 additions
and
62 deletions
+53
-62
public/app/containers/Explore/utils/dom.ts
+1
-1
public/app/core/components/form_dropdown/form_dropdown.ts
+1
-1
public/app/core/components/query_part/query_part_editor.ts
+4
-4
public/app/core/directives/tags.ts
+2
-2
public/app/core/jquery_extended.ts
+2
-2
public/app/core/services/ng_react.ts
+2
-2
public/app/core/services/popover_srv.ts
+1
-1
public/app/core/services/segment_srv.ts
+2
-2
public/app/features/dashboard/dashboard_migration.ts
+6
-9
public/app/features/dashboard/unsaved_changes_srv.ts
+1
-1
public/app/features/templating/specs/variable_srv.test.ts
+1
-1
public/app/features/templating/specs/variable_srv_init.test.ts
+1
-1
public/app/plugins/datasource/elasticsearch/datasource.ts
+2
-2
public/app/plugins/datasource/elasticsearch/specs/datasource.test.ts
+1
-1
public/app/plugins/datasource/graphite/add_graphite_func.ts
+1
-1
public/app/plugins/datasource/graphite/datasource.ts
+1
-1
public/app/plugins/datasource/graphite/func_editor.ts
+4
-4
public/app/plugins/datasource/graphite/gfunc.ts
+20
-26
No files found.
public/app/containers/Explore/utils/dom.ts
View file @
a8547ae3
// Node.closest() polyfill
if
(
'Element'
in
window
&&
!
Element
.
prototype
.
closest
)
{
Element
.
prototype
.
closest
=
function
(
s
)
{
Element
.
prototype
.
closest
=
function
(
this
:
any
,
s
)
{
const
matches
=
(
this
.
document
||
this
.
ownerDocument
).
querySelectorAll
(
s
);
let
el
=
this
;
let
i
;
...
...
public/app/core/components/form_dropdown/form_dropdown.ts
View file @
a8547ae3
import
_
from
'lodash'
;
import
coreModule
from
'../../core_module'
;
function
typeaheadMatcher
(
item
)
{
function
typeaheadMatcher
(
this
:
any
,
item
)
{
var
str
=
this
.
query
;
if
(
str
===
''
)
{
return
true
;
...
...
public/app/core/components/query_part/query_part_editor.ts
View file @
a8547ae3
...
...
@@ -33,7 +33,7 @@ export function queryPartEditorDirective($compile, templateSrv) {
$scope
.
partActions
=
[];
function
clickFuncParam
(
paramIndex
)
{
function
clickFuncParam
(
this
:
any
,
paramIndex
)
{
/*jshint validthis:true */
const
$link
=
$
(
this
);
const
$input
=
$link
.
next
();
...
...
@@ -53,7 +53,7 @@ export function queryPartEditorDirective($compile, templateSrv) {
}
}
function
inputBlur
(
paramIndex
)
{
function
inputBlur
(
this
:
any
,
paramIndex
)
{
/*jshint validthis:true */
const
$input
=
$
(
this
);
const
$link
=
$input
.
prev
();
...
...
@@ -72,14 +72,14 @@ export function queryPartEditorDirective($compile, templateSrv) {
$link
.
show
();
}
function
inputKeyPress
(
paramIndex
,
e
)
{
function
inputKeyPress
(
this
:
any
,
paramIndex
,
e
)
{
/*jshint validthis:true */
if
(
e
.
which
===
13
)
{
inputBlur
.
call
(
this
,
paramIndex
);
}
}
function
inputKeyDown
()
{
function
inputKeyDown
(
this
:
any
)
{
/*jshint validthis:true */
this
.
style
.
width
=
(
3
+
this
.
value
.
length
)
*
8
+
'px'
;
}
...
...
public/app/core/directives/tags.ts
View file @
a8547ae3
...
...
@@ -69,7 +69,7 @@ function bootstrapTagsinput() {
},
});
select
.
on
(
'itemAdded'
,
function
(
event
)
{
select
.
on
(
'itemAdded'
,
event
=>
{
if
(
scope
.
model
.
indexOf
(
event
.
item
)
===
-
1
)
{
scope
.
model
.
push
(
event
.
item
);
if
(
scope
.
onTagsUpdated
)
{
...
...
@@ -79,7 +79,7 @@ function bootstrapTagsinput() {
const
tagElement
=
select
.
next
()
.
children
(
'span'
)
.
filter
(
function
()
{
.
filter
(
()
=>
{
return
$
(
this
).
text
()
===
event
.
item
;
});
setColor
(
event
.
item
,
tagElement
);
...
...
public/app/core/jquery_extended.ts
View file @
a8547ae3
...
...
@@ -9,10 +9,10 @@ $.fn.place_tt = (function() {
offset
:
5
,
};
return
function
(
x
,
y
,
opts
)
{
return
function
(
this
:
any
,
x
,
y
,
opts
)
{
opts
=
$
.
extend
(
true
,
{},
defaults
,
opts
);
return
this
.
each
(
function
()
{
return
this
.
each
(
()
=>
{
const
$tooltip
=
$
(
this
);
let
width
,
height
;
...
...
public/app/core/services/ng_react.ts
View file @
a8547ae3
...
...
@@ -204,7 +204,7 @@ const reactComponent = function($injector) {
attrs
.
props
?
watchProps
(
attrs
.
watchDepth
,
scope
,
[
attrs
.
props
],
renderMyComponent
)
:
renderMyComponent
();
// cleanup when scope is destroyed
scope
.
$on
(
'$destroy'
,
function
()
{
scope
.
$on
(
'$destroy'
,
()
=>
{
if
(
!
attrs
.
onScopeDestroy
)
{
ReactDOM
.
unmountComponentAtNode
(
elem
[
0
]);
}
else
{
...
...
@@ -280,7 +280,7 @@ const reactDirective = function($injector) {
props
.
length
?
watchProps
(
attrs
.
watchDepth
,
scope
,
propExpressions
,
renderMyComponent
)
:
renderMyComponent
();
// cleanup when scope is destroyed
scope
.
$on
(
'$destroy'
,
function
()
{
scope
.
$on
(
'$destroy'
,
()
=>
{
if
(
!
attrs
.
onScopeDestroy
)
{
ReactDOM
.
unmountComponentAtNode
(
elem
[
0
]);
}
else
{
...
...
public/app/core/services/popover_srv.ts
View file @
a8547ae3
...
...
@@ -3,7 +3,7 @@ import coreModule from 'app/core/core_module';
import
Drop
from
'tether-drop'
;
/** @ngInject **/
function
popoverSrv
(
$compile
,
$rootScope
,
$timeout
)
{
function
popoverSrv
(
this
:
any
,
$compile
,
$rootScope
,
$timeout
)
{
let
openDrop
=
null
;
this
.
close
=
function
()
{
...
...
public/app/core/services/segment_srv.ts
View file @
a8547ae3
...
...
@@ -2,10 +2,10 @@ import _ from 'lodash';
import
coreModule
from
'../core_module'
;
/** @ngInject */
export
function
uiSegmentSrv
(
$sce
,
templateSrv
)
{
export
function
uiSegmentSrv
(
this
:
any
,
$sce
,
templateSrv
)
{
const
self
=
this
;
function
MetricSegment
(
options
)
{
function
MetricSegment
(
this
:
any
,
options
)
{
if
(
options
===
'*'
||
options
.
value
===
'*'
)
{
this
.
value
=
'*'
;
this
.
html
=
$sce
.
trustAsHtml
(
'<i class="fa fa-asterisk"><i>'
);
...
...
public/app/features/dashboard/dashboard_migration.ts
View file @
a8547ae3
...
...
@@ -140,15 +140,12 @@ export class DashboardMigrator {
}
// ensure query refIds
panelUpgrades
.
push
(
function
(
panel
)
{
_
.
each
(
panel
.
targets
,
function
(
target
)
{
if
(
!
target
.
refId
)
{
target
.
refId
=
this
.
dashboard
.
getNextQueryLetter
(
panel
);
}
}.
bind
(
this
)
);
panelUpgrades
.
push
(
panel
=>
{
_
.
each
(
panel
.
targets
,
target
=>
{
if
(
!
target
.
refId
)
{
target
.
refId
=
this
.
dashboard
.
getNextQueryLetter
(
panel
);
}
});
});
}
...
...
public/app/features/dashboard/unsaved_changes_srv.ts
View file @
a8547ae3
...
...
@@ -2,7 +2,7 @@ import angular from 'angular';
import
{
ChangeTracker
}
from
'./change_tracker'
;
/** @ngInject */
export
function
unsavedChangesSrv
(
$rootScope
,
$q
,
$location
,
$timeout
,
contextSrv
,
dashboardSrv
,
$window
)
{
export
function
unsavedChangesSrv
(
this
:
any
,
$rootScope
,
$q
,
$location
,
$timeout
,
contextSrv
,
dashboardSrv
,
$window
)
{
this
.
init
=
function
(
dashboard
,
scope
)
{
this
.
tracker
=
new
ChangeTracker
(
dashboard
,
scope
,
1000
,
$location
,
$window
,
$timeout
,
contextSrv
,
$rootScope
);
return
this
.
tracker
;
...
...
public/app/features/templating/specs/variable_srv.test.ts
View file @
a8547ae3
...
...
@@ -3,7 +3,7 @@ import { VariableSrv } from '../variable_srv';
import
moment
from
'moment'
;
import
$q
from
'q'
;
describe
(
'VariableSrv'
,
function
()
{
describe
(
'VariableSrv'
,
function
(
this
:
any
)
{
const
ctx
=
<
any
>
{
datasourceSrv
:
{},
timeSrv
:
{
...
...
public/app/features/templating/specs/variable_srv_init.test.ts
View file @
a8547ae3
...
...
@@ -4,7 +4,7 @@ import _ from 'lodash';
import
{
VariableSrv
}
from
'../variable_srv'
;
import
$q
from
'q'
;
describe
(
'VariableSrv init'
,
function
()
{
describe
(
'VariableSrv init'
,
function
(
this
:
any
)
{
const
templateSrv
=
{
init
:
vars
=>
{
this
.
variables
=
vars
;
...
...
public/app/plugins/datasource/elasticsearch/datasource.ts
View file @
a8547ae3
...
...
@@ -203,7 +203,7 @@ export class ElasticDatasource {
this
.
timeSrv
.
setTime
({
from
:
'now-1m'
,
to
:
'now'
},
true
);
// validate that the index exist and has date field
return
this
.
getFields
({
type
:
'date'
}).
then
(
function
(
dateFields
)
{
dateFields
=>
{
const
timeField
=
_
.
find
(
dateFields
,
{
text
:
this
.
timeField
});
if
(
!
timeField
)
{
return
{
...
...
@@ -212,7 +212,7 @@ export class ElasticDatasource {
};
}
return
{
status
:
'success'
,
message
:
'Index OK. Time field name OK.'
};
}
.
bind
(
this
)
,
},
function
(
err
)
{
console
.
log
(
err
);
if
(
err
.
data
&&
err
.
data
.
error
)
{
...
...
public/app/plugins/datasource/elasticsearch/specs/datasource.test.ts
View file @
a8547ae3
...
...
@@ -5,7 +5,7 @@ import { ElasticDatasource } from '../datasource';
import
*
as
dateMath
from
'app/core/utils/datemath'
;
describe
(
'ElasticDatasource'
,
function
()
{
describe
(
'ElasticDatasource'
,
function
(
this
:
any
)
{
const
backendSrv
=
{
datasourceRequest
:
jest
.
fn
(),
};
...
...
public/app/plugins/datasource/graphite/add_graphite_func.ts
View file @
a8547ae3
...
...
@@ -90,7 +90,7 @@ export function graphiteAddFunc($compile) {
};
$
(
elem
)
.
on
(
'mouseenter'
,
'ul.dropdown-menu li'
,
function
()
{
.
on
(
'mouseenter'
,
'ul.dropdown-menu li'
,
()
=>
{
cleanUpDrop
();
var
funcDef
;
...
...
public/app/plugins/datasource/graphite/datasource.ts
View file @
a8547ae3
...
...
@@ -4,7 +4,7 @@ import { isVersionGtOrEq, SemVersion } from 'app/core/utils/version';
import
gfunc
from
'./gfunc'
;
/** @ngInject */
export
function
GraphiteDatasource
(
instanceSettings
,
$q
,
backendSrv
,
templateSrv
)
{
export
function
GraphiteDatasource
(
this
:
any
,
instanceSettings
,
$q
,
backendSrv
,
templateSrv
)
{
this
.
basicAuth
=
instanceSettings
.
basicAuth
;
this
.
url
=
instanceSettings
.
url
;
this
.
name
=
instanceSettings
.
name
;
...
...
public/app/plugins/datasource/graphite/func_editor.ts
View file @
a8547ae3
...
...
@@ -28,7 +28,7 @@ export function graphiteFuncEditor($compile, templateSrv, popoverSrv) {
var
paramCountAtLink
=
0
;
var
cancelBlur
=
null
;
function
clickFuncParam
(
paramIndex
)
{
function
clickFuncParam
(
this
:
any
,
paramIndex
)
{
/*jshint validthis:true */
const
$link
=
$
(
this
);
...
...
@@ -108,7 +108,7 @@ export function graphiteFuncEditor($compile, templateSrv, popoverSrv) {
}
// this = input element
function
inputBlur
(
paramIndex
)
{
function
inputBlur
(
this
:
any
,
paramIndex
)
{
/*jshint validthis:true */
const
inputElem
=
this
;
// happens long before the click event on the typeahead options
...
...
@@ -118,14 +118,14 @@ export function graphiteFuncEditor($compile, templateSrv, popoverSrv) {
},
200
);
}
function
inputKeyPress
(
paramIndex
,
e
)
{
function
inputKeyPress
(
this
:
any
,
paramIndex
,
e
)
{
/*jshint validthis:true */
if
(
e
.
which
===
13
)
{
$
(
this
).
blur
();
}
}
function
inputKeyDown
()
{
function
inputKeyDown
(
this
:
any
)
{
/*jshint validthis:true */
this
.
style
.
width
=
(
3
+
this
.
value
.
length
)
*
8
+
'px'
;
}
...
...
public/app/plugins/datasource/graphite/gfunc.ts
View file @
a8547ae3
...
...
@@ -964,26 +964,23 @@ export class FuncInstance {
render
(
metricExp
)
{
const
str
=
this
.
def
.
name
+
'('
;
const
parameters
=
_
.
map
(
this
.
params
,
function
(
value
,
index
)
{
var
paramType
;
if
(
index
<
this
.
def
.
params
.
length
)
{
paramType
=
this
.
def
.
params
[
index
].
type
;
}
else
if
(
_
.
get
(
_
.
last
(
this
.
def
.
params
),
'multiple'
))
{
paramType
=
_
.
get
(
_
.
last
(
this
.
def
.
params
),
'type'
);
}
// param types that should never be quoted
if
(
_
.
includes
([
'value_or_series'
,
'boolean'
,
'int'
,
'float'
,
'node'
],
paramType
))
{
return
value
;
}
// param types that might be quoted
if
(
_
.
includes
([
'int_or_interval'
,
'node_or_tag'
],
paramType
)
&&
_
.
isFinite
(
+
value
))
{
return
_
.
toString
(
+
value
);
}
return
"'"
+
value
+
"'"
;
}.
bind
(
this
)
);
const
parameters
=
_
.
map
(
this
.
params
,
(
value
,
index
)
=>
{
var
paramType
;
if
(
index
<
this
.
def
.
params
.
length
)
{
paramType
=
this
.
def
.
params
[
index
].
type
;
}
else
if
(
_
.
get
(
_
.
last
(
this
.
def
.
params
),
'multiple'
))
{
paramType
=
_
.
get
(
_
.
last
(
this
.
def
.
params
),
'type'
);
}
// param types that should never be quoted
if
(
_
.
includes
([
'value_or_series'
,
'boolean'
,
'int'
,
'float'
,
'node'
],
paramType
))
{
return
value
;
}
// param types that might be quoted
if
(
_
.
includes
([
'int_or_interval'
,
'node_or_tag'
],
paramType
)
&&
_
.
isFinite
(
+
value
))
{
return
_
.
toString
(
+
value
);
}
return
"'"
+
value
+
"'"
;
});
// don't send any blank parameters to graphite
while
(
parameters
[
parameters
.
length
-
1
]
===
''
)
{
...
...
@@ -1017,12 +1014,9 @@ export class FuncInstance {
// handle optional parameters
// if string contains ',' and next param is optional, split and update both
if
(
this
.
_hasMultipleParamsInString
(
strValue
,
index
))
{
_
.
each
(
strValue
.
split
(
','
),
function
(
partVal
,
idx
)
{
this
.
updateParam
(
partVal
.
trim
(),
index
+
idx
);
}.
bind
(
this
)
);
_
.
each
(
strValue
.
split
(
','
),
(
partVal
,
idx
)
=>
{
this
.
updateParam
(
partVal
.
trim
(),
index
+
idx
);
});
return
;
}
...
...
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