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
c9ae585d
Commit
c9ae585d
authored
Sep 05, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '12918-no-conditional-assignment'
parents
00c0b71f
dc236b50
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
17 deletions
+38
-17
public/app/containers/Explore/utils/dom.ts
+2
-1
public/app/core/components/search/search.ts
+2
-2
public/app/core/directives/rebuild_on_change.ts
+3
-1
public/app/features/dashboard/dashboard_import_ctrl.ts
+3
-1
public/app/features/dashboard/upload.ts
+7
-2
public/app/plugins/datasource/graphite/datasource.ts
+6
-4
public/app/plugins/datasource/graphite/lexer.ts
+3
-2
public/app/plugins/datasource/logging/result_transformer.ts
+3
-2
public/app/plugins/datasource/prometheus/datasource.ts
+4
-2
public/sass/components/_search.scss
+4
-0
tslint.json
+1
-0
No files found.
public/app/containers/Explore/utils/dom.ts
View file @
c9ae585d
...
@@ -9,7 +9,8 @@ if ('Element' in window && !Element.prototype.closest) {
...
@@ -9,7 +9,8 @@ if ('Element' in window && !Element.prototype.closest) {
i
=
matches
.
length
;
i
=
matches
.
length
;
// eslint-disable-next-line
// eslint-disable-next-line
while
(
--
i
>=
0
&&
matches
.
item
(
i
)
!==
el
)
{}
while
(
--
i
>=
0
&&
matches
.
item
(
i
)
!==
el
)
{}
}
while
(
i
<
0
&&
(
el
=
el
.
parentElement
));
el
=
el
.
parentElement
;
}
while
(
i
<
0
&&
el
);
return
el
;
return
el
;
};
};
}
}
...
...
public/app/core/components/search/search.ts
View file @
c9ae585d
...
@@ -130,8 +130,8 @@ export class SearchCtrl {
...
@@ -130,8 +130,8 @@ export class SearchCtrl {
}
}
const
max
=
flattenedResult
.
length
;
const
max
=
flattenedResult
.
length
;
let
newIndex
=
this
.
selectedIndex
+
direction
;
const
newIndex
=
(
this
.
selectedIndex
+
direction
)
%
max
;
this
.
selectedIndex
=
(
newIndex
%=
max
)
<
0
?
newIndex
+
max
:
newIndex
;
this
.
selectedIndex
=
newIndex
<
0
?
newIndex
+
max
:
newIndex
;
const
selectedItem
=
flattenedResult
[
this
.
selectedIndex
];
const
selectedItem
=
flattenedResult
[
this
.
selectedIndex
];
if
(
selectedItem
.
dashboardIndex
===
undefined
&&
this
.
results
[
selectedItem
.
folderIndex
].
id
===
0
)
{
if
(
selectedItem
.
dashboardIndex
===
undefined
&&
this
.
results
[
selectedItem
.
folderIndex
].
id
===
0
)
{
...
...
public/app/core/directives/rebuild_on_change.ts
View file @
c9ae585d
...
@@ -5,14 +5,16 @@ function getBlockNodes(nodes) {
...
@@ -5,14 +5,16 @@ function getBlockNodes(nodes) {
let
node
=
nodes
[
0
];
let
node
=
nodes
[
0
];
const
endNode
=
nodes
[
nodes
.
length
-
1
];
const
endNode
=
nodes
[
nodes
.
length
-
1
];
let
blockNodes
;
let
blockNodes
;
node
=
node
.
nextSibling
;
for
(
let
i
=
1
;
node
!==
endNode
&&
(
node
=
node
.
nextSibling
)
;
i
++
)
{
for
(
let
i
=
1
;
node
!==
endNode
&&
node
;
i
++
)
{
if
(
blockNodes
||
nodes
[
i
]
!==
node
)
{
if
(
blockNodes
||
nodes
[
i
]
!==
node
)
{
if
(
!
blockNodes
)
{
if
(
!
blockNodes
)
{
blockNodes
=
$
([].
slice
.
call
(
nodes
,
0
,
i
));
blockNodes
=
$
([].
slice
.
call
(
nodes
,
0
,
i
));
}
}
blockNodes
.
push
(
node
);
blockNodes
.
push
(
node
);
}
}
node
=
node
.
nextSibling
;
}
}
return
blockNodes
||
nodes
;
return
blockNodes
||
nodes
;
...
...
public/app/features/dashboard/dashboard_import_ctrl.ts
View file @
c9ae585d
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
import
locationUtil
from
'app/core/utils/location_util'
;
export
class
DashboardImportCtrl
{
export
class
DashboardImportCtrl
{
navModel
:
any
;
navModel
:
any
;
...
@@ -179,7 +180,8 @@ export class DashboardImportCtrl {
...
@@ -179,7 +180,8 @@ export class DashboardImportCtrl {
folderId
:
this
.
folderId
,
folderId
:
this
.
folderId
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
$location
.
url
(
res
.
importedUrl
);
const
dashUrl
=
locationUtil
.
stripBaseFromUrl
(
res
.
importedUrl
);
this
.
$location
.
url
(
dashUrl
);
});
});
}
}
...
...
public/app/features/dashboard/upload.ts
View file @
c9ae585d
...
@@ -36,10 +36,15 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
...
@@ -36,10 +36,15 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
};
};
};
};
for
(
let
i
=
0
,
f
;
(
f
=
files
[
i
]);
i
++
)
{
let
i
=
0
;
let
file
=
files
[
i
];
while
(
file
)
{
const
reader
=
new
FileReader
();
const
reader
=
new
FileReader
();
reader
.
onload
=
readerOnload
();
reader
.
onload
=
readerOnload
();
reader
.
readAsText
(
f
);
reader
.
readAsText
(
file
);
i
+=
1
;
file
=
files
[
i
];
}
}
}
}
...
...
public/app/plugins/datasource/graphite/datasource.ts
View file @
c9ae585d
...
@@ -218,9 +218,10 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
...
@@ -218,9 +218,10 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
if
(
matches
)
{
if
(
matches
)
{
const
expressions
=
[];
const
expressions
=
[];
const
exprRegex
=
/, *
([^
,
]
+
)
/g
;
const
exprRegex
=
/, *
([^
,
]
+
)
/g
;
let
match
;
let
match
=
exprRegex
.
exec
(
matches
[
2
])
;
while
(
(
match
=
exprRegex
.
exec
(
matches
[
2
]))
!==
null
)
{
while
(
match
!==
null
)
{
expressions
.
push
(
match
[
1
]);
expressions
.
push
(
match
[
1
]);
match
=
exprRegex
.
exec
(
matches
[
2
]);
}
}
options
.
limit
=
10000
;
options
.
limit
=
10000
;
return
this
.
getTagValuesAutoComplete
(
expressions
,
matches
[
1
],
undefined
,
options
);
return
this
.
getTagValuesAutoComplete
(
expressions
,
matches
[
1
],
undefined
,
options
);
...
@@ -233,9 +234,10 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
...
@@ -233,9 +234,10 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
if
(
matches
[
1
])
{
if
(
matches
[
1
])
{
expressions
.
push
(
matches
[
1
]);
expressions
.
push
(
matches
[
1
]);
const
exprRegex
=
/, *
([^
,
]
+
)
/g
;
const
exprRegex
=
/, *
([^
,
]
+
)
/g
;
let
match
;
let
match
=
exprRegex
.
exec
(
matches
[
2
])
;
while
(
(
match
=
exprRegex
.
exec
(
matches
[
2
]))
!==
null
)
{
while
(
match
!==
null
)
{
expressions
.
push
(
match
[
1
]);
expressions
.
push
(
match
[
1
]);
match
=
exprRegex
.
exec
(
matches
[
2
]);
}
}
}
}
options
.
limit
=
10000
;
options
.
limit
=
10000
;
...
...
public/app/plugins/datasource/graphite/lexer.ts
View file @
c9ae585d
...
@@ -941,9 +941,10 @@ Lexer.prototype = {
...
@@ -941,9 +941,10 @@ Lexer.prototype = {
tokenize
:
function
()
{
tokenize
:
function
()
{
const
list
=
[];
const
list
=
[];
let
token
;
let
token
=
this
.
next
()
;
while
(
(
token
=
this
.
next
())
)
{
while
(
token
)
{
list
.
push
(
token
);
list
.
push
(
token
);
token
=
this
.
next
();
}
}
return
list
;
return
list
;
},
},
...
...
public/app/plugins/datasource/logging/result_transformer.ts
View file @
c9ae585d
...
@@ -26,13 +26,14 @@ export function getSearchMatches(line: string, search: string) {
...
@@ -26,13 +26,14 @@ export function getSearchMatches(line: string, search: string) {
}
}
const
regexp
=
new
RegExp
(
`(?:
${
search
}
)`
,
'g'
);
const
regexp
=
new
RegExp
(
`(?:
${
search
}
)`
,
'g'
);
const
matches
=
[];
const
matches
=
[];
let
match
;
let
match
=
regexp
.
exec
(
line
)
;
while
(
(
match
=
regexp
.
exec
(
line
))
)
{
while
(
match
)
{
matches
.
push
({
matches
.
push
({
text
:
match
[
0
],
text
:
match
[
0
],
start
:
match
.
index
,
start
:
match
.
index
,
length
:
match
[
0
].
length
,
length
:
match
[
0
].
length
,
});
});
match
=
regexp
.
exec
(
line
);
}
}
return
matches
;
return
matches
;
}
}
...
...
public/app/plugins/datasource/prometheus/datasource.ts
View file @
c9ae585d
...
@@ -55,11 +55,12 @@ export function addLabelToQuery(query: string, key: string, value: string): stri
...
@@ -55,11 +55,12 @@ export function addLabelToQuery(query: string, key: string, value: string): stri
// Adding label to existing selectors
// Adding label to existing selectors
const
selectorRegexp
=
/{
([^
{
]
*
)
}/g
;
const
selectorRegexp
=
/{
([^
{
]
*
)
}/g
;
let
match
=
null
;
let
match
=
selectorRegexp
.
exec
(
query
)
;
const
parts
=
[];
const
parts
=
[];
let
lastIndex
=
0
;
let
lastIndex
=
0
;
let
suffix
=
''
;
let
suffix
=
''
;
while
((
match
=
selectorRegexp
.
exec
(
query
)))
{
while
(
match
)
{
const
prefix
=
query
.
slice
(
lastIndex
,
match
.
index
);
const
prefix
=
query
.
slice
(
lastIndex
,
match
.
index
);
const
selectorParts
=
match
[
1
].
split
(
','
);
const
selectorParts
=
match
[
1
].
split
(
','
);
const
labels
=
selectorParts
.
reduce
((
acc
,
label
)
=>
{
const
labels
=
selectorParts
.
reduce
((
acc
,
label
)
=>
{
...
@@ -77,6 +78,7 @@ export function addLabelToQuery(query: string, key: string, value: string): stri
...
@@ -77,6 +78,7 @@ export function addLabelToQuery(query: string, key: string, value: string): stri
lastIndex
=
match
.
index
+
match
[
1
].
length
+
2
;
lastIndex
=
match
.
index
+
match
[
1
].
length
+
2
;
suffix
=
query
.
slice
(
match
.
index
+
match
[
0
].
length
);
suffix
=
query
.
slice
(
match
.
index
+
match
[
0
].
length
);
parts
.
push
(
prefix
,
'{'
,
selector
,
'}'
);
parts
.
push
(
prefix
,
'{'
,
selector
,
'}'
);
match
=
selectorRegexp
.
exec
(
query
);
}
}
parts
.
push
(
suffix
);
parts
.
push
(
suffix
);
return
parts
.
join
(
''
);
return
parts
.
join
(
''
);
...
...
public/sass/components/_search.scss
View file @
c9ae585d
...
@@ -192,6 +192,10 @@
...
@@ -192,6 +192,10 @@
&
:hover
,
&
:hover
,
&
.selected
{
&
.selected
{
background
:
$list-item-hover-bg
;
background
:
$list-item-hover-bg
;
.search-item__body-title
{
color
:
$text-color-strong
;
}
}
}
}
}
...
...
tslint.json
View file @
c9ae585d
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
"no-angle-bracket-type-assertion"
:
true
,
"no-angle-bracket-type-assertion"
:
true
,
"no-arg"
:
true
,
"no-arg"
:
true
,
"no-bitwise"
:
false
,
"no-bitwise"
:
false
,
"no-conditional-assignment"
:
true
,
"no-console"
:
[
true
,
"debug"
,
"info"
,
"time"
,
"timeEnd"
,
"trace"
],
"no-console"
:
[
true
,
"debug"
,
"info"
,
"time"
,
"timeEnd"
,
"trace"
],
"no-construct"
:
true
,
"no-construct"
:
true
,
"no-debugger"
:
true
,
"no-debugger"
:
true
,
...
...
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