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
c960af09
Commit
c960af09
authored
Aug 30, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tslint: added 1 more rule, #12918
parent
0bb24909
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
public/app/core/components/json_explorer/helpers.ts
+10
-10
public/app/features/dashboard/export_data/export_data_modal.ts
+2
-2
tslint.json
+6
-0
No files found.
public/app/core/components/json_explorer/helpers.ts
View file @
c960af09
...
@@ -21,7 +21,7 @@ export function isObject(value: any): boolean {
...
@@ -21,7 +21,7 @@ export function isObject(value: any): boolean {
* From http://stackoverflow.com/a/332429
* From http://stackoverflow.com/a/332429
*
*
*/
*/
export
function
getObjectName
(
object
:
O
bject
):
string
{
export
function
getObjectName
(
object
:
o
bject
):
string
{
if
(
object
===
undefined
)
{
if
(
object
===
undefined
)
{
return
''
;
return
''
;
}
}
...
@@ -44,7 +44,7 @@ export function getObjectName(object: Object): string {
...
@@ -44,7 +44,7 @@ export function getObjectName(object: Object): string {
/*
/*
* Gets type of an object. Returns "null" for null objects
* Gets type of an object. Returns "null" for null objects
*/
*/
export
function
getType
(
object
:
O
bject
):
string
{
export
function
getType
(
object
:
o
bject
):
string
{
if
(
object
===
null
)
{
if
(
object
===
null
)
{
return
'null'
;
return
'null'
;
}
}
...
@@ -54,7 +54,7 @@ export function getType(object: Object): string {
...
@@ -54,7 +54,7 @@ export function getType(object: Object): string {
/*
/*
* Generates inline preview for a JavaScript object based on a value
* Generates inline preview for a JavaScript object based on a value
*/
*/
export
function
getValuePreview
(
object
:
O
bject
,
value
:
string
):
string
{
export
function
getValuePreview
(
object
:
o
bject
,
value
:
string
):
string
{
const
type
=
getType
(
object
);
const
type
=
getType
(
object
);
if
(
type
===
'null'
||
type
===
'undefined'
)
{
if
(
type
===
'null'
||
type
===
'undefined'
)
{
...
@@ -79,15 +79,15 @@ export function getValuePreview(object: Object, value: string): string {
...
@@ -79,15 +79,15 @@ export function getValuePreview(object: Object, value: string): string {
/*
/*
* Generates inline preview for a JavaScript object
* Generates inline preview for a JavaScript object
*/
*/
export
function
getPreview
(
object
:
string
):
string
{
let
value
=
''
;
let
value
=
''
;
export
function
getPreview
(
obj
:
object
):
string
{
if
(
isObject
(
obj
ect
))
{
if
(
isObject
(
obj
))
{
value
=
getObjectName
(
obj
ect
);
value
=
getObjectName
(
obj
);
if
(
Array
.
isArray
(
obj
ect
))
{
if
(
Array
.
isArray
(
obj
))
{
value
+=
'['
+
obj
ect
.
length
+
']'
;
value
+=
'['
+
obj
.
length
+
']'
;
}
}
}
else
{
}
else
{
value
=
getValuePreview
(
obj
ect
,
object
);
value
=
getValuePreview
(
obj
,
obj
.
toString
()
);
}
}
return
value
;
return
value
;
}
}
...
...
public/app/features/dashboard/export_data/export_data_modal.ts
View file @
c960af09
...
@@ -5,9 +5,9 @@ import appEvents from 'app/core/app_events';
...
@@ -5,9 +5,9 @@ import appEvents from 'app/core/app_events';
export
class
ExportDataModalCtrl
{
export
class
ExportDataModalCtrl
{
private
data
:
any
[];
private
data
:
any
[];
private
panel
:
string
;
private
panel
:
string
;
asRows
:
Boolean
=
true
;
asRows
=
true
;
dateTimeFormat
=
'YYYY-MM-DDTHH:mm:ssZ'
;
dateTimeFormat
=
'YYYY-MM-DDTHH:mm:ssZ'
;
excel
:
false
;
excel
=
false
;
export
()
{
export
()
{
if
(
this
.
panel
===
'table'
)
{
if
(
this
.
panel
===
'table'
)
{
...
...
tslint.json
View file @
c960af09
...
@@ -5,6 +5,12 @@
...
@@ -5,6 +5,12 @@
"ban"
:
[
true
,
"ban"
:
[
true
,
{
"name"
:
"Array"
,
"message"
:
"tsstyle#array-constructor"
}
{
"name"
:
"Array"
,
"message"
:
"tsstyle#array-constructor"
}
],
],
"ban-types"
:
[
true
,
[
"Object"
,
"Use {} instead."
],
[
"String"
,
"Use 'string' instead."
],
[
"Number"
,
"Use 'number' instead."
],
[
"Boolean"
,
"Use 'boolean' instead."
]
],
"interface-name"
:
[
true
,
"never-prefix"
],
"interface-name"
:
[
true
,
"never-prefix"
],
"no-string-throw"
:
true
,
"no-string-throw"
:
true
,
"no-unused-expression"
:
true
,
"no-unused-expression"
:
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